home *** CD-ROM | disk | FTP | other *** search
/ Scene Storm / Scene Storm - Volume 1.iso / coding / asm / utils / crossword / includes / cwclues.i next >
Encoding:
Text File  |  1980-01-04  |  40.1 KB  |  1,974 lines

  1.  
  2.  
  3. * Code include file for handling clue list generation.
  4. * Includes all the requesters for this (except the
  5. * InfoReq used for other things too) and the gadgetry
  6. * for it too. Images live in a separate file.
  7.  
  8.  
  9. * NewClueList(a6) -> d0
  10. * a6 = ptr to main program variables
  11.  
  12. * Generate the clue list information from the grid.
  13. * Generate clue numbers, start squares of clues and
  14. * prepare for text management.
  15.  
  16. * returns d0=0 if failed to do it for some reason,
  17. * d0=-1 if successful.
  18.  
  19. * d0/d6-d7/a0-a2 corrupt
  20.  
  21.  
  22. NewClueList    bclr    #4,applic_flag1(a6)    ;kill clue list flag
  23.  
  24.         move.l    clue_list(a6),a0        ;ensure clue list
  25.         clr.l    clh_AcList(a0)        ;pointers not
  26.         clr.l    clh_DnList(a0)        ;valid ones at start
  27.  
  28.         btst    #6,applic_flag1(a6)    ;which grid type?
  29.         bne    NCL_b11            ;skip if type 2 grid
  30.  
  31.  
  32. * Here get information for Type 1 grid. First find out how many
  33. * clues there are.
  34.  
  35.  
  36.         move.l    grid_array(a6),a0        ;ptr to grid array
  37.         move.l    clue_list(a6),a1        ;ptr to header
  38.  
  39.         moveq    #0,d0
  40.  
  41.         move.w    d0,clh_AcCount(a1)    ;clear clue
  42.         move.w    d0,clh_DnCount(a1)    ;counts
  43.  
  44.         moveq    #1,d7            ;set square no.
  45.         swap    d7            ;(1,1)
  46.         move.w    #1,d7
  47.  
  48.         move.w    grid_down(a6),d6        ;set row & column
  49.         swap    d6            ;limits
  50.         move.w    grid_across(a6),d6
  51.         move.w    d6,d5
  52.         add.w    d5,d5
  53.         neg.w    d5            ;use as backward &
  54.         swap    d5            ;forward offsets
  55.         move.w    d6,d5            ;to next & prev rows
  56.         add.w    d5,d5
  57.  
  58. NCL_l1        move.w    (a0),d0            ;get array element
  59.  
  60.         tst.b    d0            ;black square?
  61.         beq.s    NCL_b1            ;skip if so
  62.  
  63.  
  64. * First of all, test for start of across clue.
  65.  
  66.  
  67.         cmp.w    #1,d7            ;start of row?
  68.         beq.s    NCL_b2            ;don't test prev if so
  69.  
  70.         tst.b    -1(a0)            ;prev square black?
  71.         bne.s    NCL_b3            ;skip if not
  72.  
  73. NCL_b2        cmp.w    d6,d7            ;end square of row?
  74.         beq.s    NCL_b3            ;don't test next if so
  75.  
  76.         tst.b    3(a0)            ;next square white?
  77.         beq.s    NCL_b3            ;skip if not
  78.  
  79.  
  80. * If we've fallen through to here, then we've found the start of
  81. * an across clue. Mark it as such and store back.
  82.  
  83.  
  84.         bset    #15,d0            ;set 'across start'
  85.         addq.w    #1,clh_AcCount(a1)    ;and increment count
  86.  
  87.  
  88. * Now test for start of down clue.
  89.  
  90.  
  91. NCL_b3        swap    d6            ;get down square
  92.         swap    d7            ;position data
  93.  
  94.         cmp.w    #1,d7            ;start of column?
  95.         beq.s    NCL_b4            ;don't test prev if so
  96.  
  97.         swap    d5            ;get negative offset
  98.         lea    1(a0,d5.w),a2
  99.         swap    d5
  100.         tst.b    (a2)            ;prev square black?
  101.         bne.s    NCL_b5            ;skip if not
  102.  
  103. NCL_b4        cmp.w    d6,d7            ;end square of column?
  104.         beq.s    NCL_b5            ;don't test next if so
  105.  
  106.         tst.b    1(a0,d5.w)        ;next square white?
  107.         beq.s    NCL_b5            ;skip if not
  108.  
  109.  
  110. * If we've fallen through to here, then we've found the start
  111. * of a down clue. Mark it as such.
  112.  
  113.  
  114.         bset    #14,d0            ;set 'down start'
  115.         addq.w    #1,clh_DnCount(a1)    ;& increment count
  116.  
  117. NCL_b5        swap    d6            ;recover across
  118.         swap    d7            ;position data
  119.  
  120. NCL_b1        move.w    d0,(a0)+            ;store data back
  121.  
  122.         addq.w    #1,d7            ;next square in row
  123.         cmp.w    d6,d7            ;hit end?
  124.         bls.s    NCL_l1            ;back if not
  125.  
  126.         move.w    #1,d7            ;else reset to start
  127.         swap    d6            ;and get column
  128.         swap    d7            ;data
  129.  
  130.         addq.w    #1,d7            ;next column
  131.         cmp.w    d6,d7            ;end of grid?
  132.         bhi.s    NCL_b6            ;exit if so
  133.  
  134.         swap    d6            ;recover row data
  135.         swap    d7
  136.  
  137.         bra.s    NCL_l1            ;and continue
  138.  
  139.  
  140. * Now begin creating the list data entries. Reserve some memory
  141. * for the list entries in each case. If can't do it, abort with
  142. * the failure code.
  143.  
  144.  
  145. NCL_b6        move.l    clue_list(a6),a0        ;ptr to header
  146.  
  147.         move.w    #cle_sizeof,d0        ;amount of memory
  148.         mulu    clh_AcCount(a0),d0    ;to reserve
  149.  
  150.         move.l    #MEMF_PUBLIC+MEMF_CLEAR,d1
  151.  
  152.         CALLEXEC    AllocMem
  153.  
  154.         move.l    clue_list(a6),a0
  155.         move.l    d0,clh_AcList(a0)        ;save ptr
  156.         beq    NCL_Done            ;exit if nonexistent
  157.  
  158.         move.w    #cle_sizeof,d0
  159.         mulu    clh_DnCount(a0),d0
  160.  
  161.         move.l    #MEMF_PUBLIC+MEMF_CLEAR,d1
  162.  
  163.         CALLEXEC    AllocMem
  164.  
  165.         move.l    clue_list(a6),a0
  166.         move.l    d0,clh_DnList(a0)        ;save ptr
  167.         beq    NCL_Done            ;exit if nonexistent
  168.  
  169.  
  170. * If we reach here, then we've got memory for the clue lists.
  171. * Now begin setting them up.
  172.  
  173.  
  174.         move.l    grid_array(a6),a0
  175.  
  176.         move.l    clue_list(a6),a1
  177.  
  178.         move.l    clh_DnList(a1),a2    ;ptr to Down list
  179.         move.l    clh_AcList(a1),a1    ;ptr to Across list
  180.  
  181.         moveq    #1,d7        ;start at square
  182.         swap    d7        ;(1,1)
  183.         move.w    #1,d7
  184.  
  185.         move.w    grid_down(a6),d6
  186.         swap    d6
  187.         move.w    grid_across(a6),d6
  188.  
  189.         moveq    #1,d5        ;1st clue number
  190.  
  191. NCL_l2        move.w    (a0),d0        ;get grid data
  192.  
  193.         move.w    d0,d1
  194.         and.w    #$C000,d1    ;any clue data?
  195.         beq.s    NCL_b9        ;no, so skip
  196.  
  197.         bclr    #15,d0        ;was it an Across clue?
  198.         beq.s    NCL_b7        ;no, so skip
  199.  
  200.         move.w    d7,cle_AcSq(a1)    ;set square pos for this
  201.         swap    d7        ;clue
  202.         move.w    d7,cle_DnSq(a1)
  203.         swap    d7
  204.  
  205.         move.w    d5,cle_Num(a1)    ;clue number
  206.         clr.l    cle_Text(a1)    ;no text yet!
  207.         clr.b    cle_Solved    ;not solved yet!
  208.  
  209.         add.w    #cle_sizeof,a1    ;ready the next entry
  210.  
  211. NCL_b7        bclr    #14,d0        ;was it a Down clue?
  212.         beq.s    NCL_b8        ;no, so skip
  213.  
  214.         move.w    d7,cle_AcSq(a2)    ;set square pos for this
  215.         swap    d7        ;clue
  216.         move.w    d7,cle_DnSq(a2)
  217.         swap    d7
  218.  
  219.         move.w    d5,cle_Num(a2)    ;clue number
  220.         clr.l    cle_Text(a2)    ;no text yet!
  221.         clr.b    cle_Solved    ;not solved yet!
  222.  
  223.         add.w    #cle_sizeof,a2    ;ready the next entry
  224.  
  225. NCL_b8        addq.w    #1,d5        ;next clue number
  226.  
  227. NCL_b9        move.w    d0,(a0)+        ;save square back
  228.  
  229.         addq.w    #1,d7        ;next square across
  230.         cmp.w    d6,d7        ;end of row?
  231.         bls.s    NCL_l2        ;back if not
  232.  
  233.         move.w    #1,d7        ;reset to start of row
  234.  
  235.         swap    d7        ;get down square
  236.         swap    d6        ;position
  237.  
  238.         addq.w    #1,d7        ;next square down
  239.         cmp.w    d6,d7        ;end of grid?
  240.         bhi.s    NCL_b10        ;exit if so
  241.  
  242.         swap    d6        ;get across square
  243.         swap    d7        ;position
  244.  
  245.         bra.s    NCL_l2        ;and back for more
  246.  
  247.  
  248. * If we get here, then we've succeeded. A clue list table exists.
  249.  
  250.  
  251. NCL_b10        bset    #4,applic_flag1(a6)    ;set clue exists flag
  252.         moveq    #-1,d0
  253.  
  254. NCL_Done        rts
  255.  
  256.  
  257. * We come here if it's a Type 2 crossword. First find out how
  258. * many clues there are, and where they are as for Type 1. But
  259. * branch back to allocate the memory etc.
  260.  
  261.  
  262. NCL_b11        move.l    grid_array(a6),a0        ;ptr to grid array
  263.         move.l    clue_list(a6),a1        ;ptr to header
  264.  
  265.         moveq    #0,d0
  266.  
  267.         move.w    d0,clh_AcCount(a1)    ;clear clue
  268.         move.w    d0,clh_DnCount(a1)    ;counts
  269.  
  270.         moveq    #1,d7            ;set square no.
  271.         swap    d7            ;(1,1)
  272.         move.w    #1,d7
  273.  
  274.         move.w    grid_down(a6),d6        ;set row & column
  275.         swap    d6            ;limits
  276.         move.w    grid_across(a6),d6
  277.         move.w    d6,d5
  278.         add.w    d5,d5
  279.         neg.w    d5            ;use as backward &
  280.  
  281. ;        swap    d5            ;forward offsets
  282. ;        move.w    d6,d5            ;to next & prev rows
  283. ;        add.w    d5,d5
  284.  
  285.  
  286. NCL_l3        move.w    (a0),d0            ;get grid array data
  287.  
  288.  
  289. * First of all, test for start of across clue.
  290.  
  291.  
  292.         cmp.w    #1,d7            ;start of row?
  293.         beq.s    NCL_b12            ;don't test prev if so
  294.  
  295.         btst    #0,-2(a0)        ;prev square barred?
  296.         beq.s    NCL_b13            ;skip if not
  297.  
  298. NCL_b12        cmp.w    d6,d7            ;end square of row?
  299.         beq.s    NCL_b13            ;don't test next if so
  300.  
  301.         btst    #8,d0            ;this square barred?
  302.         bne.s    NCL_b13            ;skip if so
  303.  
  304.  
  305. * If we've fallen through to here, then we've found the start of
  306. * an across clue. Mark it as such and store back.
  307.  
  308.  
  309.         bset    #15,d0            ;set 'across start'
  310.         addq.w    #1,clh_AcCount(a1)    ;and increment count
  311.  
  312.  
  313. * Now test for start of down clue.
  314.  
  315.  
  316. NCL_b13        swap    d6            ;get down square
  317.         swap    d7            ;position data
  318.  
  319.         cmp.w    #1,d7            ;start of column?
  320.         beq.s    NCL_b14            ;don't test prev if so
  321.  
  322. ;        swap    d5            ;get negative offset
  323.         lea    0(a0,d5.w),a2
  324. ;        swap    d5
  325.         btst    #1,(a2)            ;prev square barred?
  326.         beq.s    NCL_b15            ;skip if not
  327.  
  328. NCL_b14        cmp.w    d6,d7            ;end square of column?
  329.         beq.s    NCL_b15            ;don't test next if so
  330.  
  331.         btst    #9,d0            ;this square barred?
  332.         bne.s    NCL_b15            ;skip if so
  333.  
  334.  
  335. * If we've fallen through to here, then we've found the start
  336. * of a down clue. Mark it as such.
  337.  
  338.  
  339.         bset    #14,d0            ;set 'down start'
  340.         addq.w    #1,clh_DnCount(a1)    ;& increment count
  341.  
  342. NCL_b15        swap    d6            ;recover across
  343.         swap    d7            ;position data
  344.  
  345.         move.w    d0,(a0)+            ;store data back
  346.  
  347.         addq.w    #1,d7            ;next square in row
  348.         cmp.w    d6,d7            ;hit end?
  349.         bls.s    NCL_l3            ;back if not
  350.  
  351.         move.w    #1,d7            ;else reset to start
  352.         swap    d6            ;and get column
  353.         swap    d7            ;data
  354.  
  355.         addq.w    #1,d7            ;next column
  356.         cmp.w    d6,d7            ;end of grid?
  357.         bhi    NCL_b6            ;exit if so
  358.  
  359.         swap    d6            ;recover row data
  360.         swap    d7
  361.  
  362.         bra.s    NCL_l3            ;and continue
  363.  
  364.  
  365. * DisposeClueList(a6)
  366. * a6 = ptr to main program variables
  367.  
  368. * Get rid of clue lists & deallocate the memory
  369.  
  370. * DOES NOT DEALLOCATE TEXTS MEMORY!
  371.  
  372. * d0-d1/a0-a1 corrupt
  373.  
  374.  
  375. DisposeClueList    move.l    clue_list(a6),a0
  376.  
  377.         move.l    clh_AcList(a0),d0        ;Across list exists?
  378.         beq.s    DCL_1            ;skip if not
  379.  
  380.         move.l    d0,a1
  381.         move.w    #cle_sizeof,d0
  382.         mulu    clh_AcCount(a0),d0    ;get rid of Across
  383.         CALLEXEC    FreeMem            ;list
  384.  
  385.         move.l    clue_list(a6),a0        ;and ensure that
  386.         clr.l    clh_AcList(a0)        ;it doesn't exist
  387.  
  388. DCL_1        move.l    clue_list(a6),a0
  389.  
  390.         move.l    clh_DnList(a0),d0        ;Down list exists?
  391.         beq.s    DCL_2            ;skip if not
  392.  
  393.         move.l    d0,a1
  394.         move.w    #cle_sizeof,d0
  395.         mulu    clh_DnCount(a0),d0    ;get rid of Across
  396.         CALLEXEC    FreeMem            ;list
  397.  
  398.         move.l    clue_list(a6),a0        ;and ensure that
  399.         clr.l    clh_DnList(a0)        ;it doesn't exist
  400.  
  401. DCL_2        bclr    #4,applic_flag1(a6)    ;kill clue exists flag
  402.  
  403.         rts
  404.  
  405.  
  406. ATSIZE        equ    60    ;assumed average no of chars in clue
  407.  
  408.  
  409. * AllocText(a6) -> d0
  410. * a6 = ptr to main program variables
  411. * Create the memory area for the ClueTexts once
  412. * the clue list is in existence.
  413.  
  414. * Returns d0=0 if failed for some reason,
  415. * d0=-1 if successful.
  416.  
  417. * d0-d1/a0 corrupt
  418.  
  419.  
  420. AllocText    move.l    clue_list(a6),a0    ;get ptr to clue list
  421.         move.l    clh_AcList(a0),d0    ;Across list ptr exists?
  422.         beq.s    ATxt_Done    ;exit if not
  423.  
  424.         move.l    clh_DnList(a0),d0    ;Down list ptr exists?
  425.         beq.s    ATxt_Done    ;exit if not
  426.  
  427.         move.w    clh_AcCount(a0),d0
  428.         add.w    clh_DnCount(a0),d0    ;total no of clues...
  429.  
  430.         mulu    #ATSIZE,d0    ; * avg no of chars per clue
  431.  
  432.         move.l    #MEMF_PUBLIC+MEMF_CLEAR,d1
  433.  
  434.         CALLEXEC    AllocMem        ;got memory area?
  435.  
  436.         move.l    d0,clue_texts(a6)    ;soon find out...
  437.  
  438.         beq.s    ATxt_Done    ;no we haven't, so skip
  439.  
  440.         move.l    d0,clue_endptr(a6)    ;else set things up
  441.         clr.l    clue_thisone(a6)        ;for clue editing
  442.  
  443.         moveq    #-1,d0        ;and signal success
  444.  
  445. ATxt_Done    rts
  446.  
  447.  
  448. * FreeText(a6)
  449. * a6 = ptr to main program variables
  450.  
  451. * Free clue text memory area requested by AllocText() above.
  452.  
  453. * d0/a0-a1 corrupt
  454.  
  455.  
  456. FreeText        move.l    clue_texts(a6),d0        ;ptr exists?
  457.         beq.s    FTxt_Done        ;no, don't free
  458.  
  459.         move.l    d0,a1
  460.         move.l    clue_list(a6),a0
  461.         move.w    clh_AcCount(a0),d0
  462.         add.w    clh_DnCount(a0),d0
  463.  
  464.         mulu    #ATSIZE,d0
  465.  
  466.         CALLEXEC    FreeMem            ;release the memory
  467.  
  468.         clr.l    clue_texts(a6)        ;ensure nonexistent
  469.  
  470. FTxt_Done    rts
  471.  
  472.  
  473.  
  474. * CreateClueList(a6)
  475. * a6 = ptr to main program variables
  476.  
  477. * Call all of the routines required to create clue lists
  478. * and report any failures to do so.
  479.  
  480.  
  481. * d0-d7/a0-a2 corrupt
  482.  
  483.  
  484. CreateClueList    btst    #1,applic_flag2(a6)    ;HELP on?
  485.         beq.s    CCL_00            ;skip if not
  486.  
  487.         lea    Help_ML(pc),a0    ;else pop up
  488.         moveq    #5,d0        ;help box
  489.         bsr    _PopUpQR
  490.  
  491.         beq.s    CCL_02        ;skip if user cancels
  492.  
  493.  
  494. * Come here directly if no HELP on. Check if there are any white
  495. * squares in the grid.
  496.  
  497.  
  498. CCL_00        tst.w    WSCount(a6)        ;blank grid?
  499.         bne.s    CCL_01            ;skip if not
  500.  
  501.  
  502. * All black squares, so clue list can't exist. Tell user, and leave
  503. * this routine NOW.
  504.  
  505.  
  506.         lea    NWSListW(pc),a0    ;inform user that clue
  507.         lea    IRT_1(pc),a1    ;list construction is
  508.         moveq    #4,d0        ;pointless on a
  509.  
  510.         move.l    a0,irt_tlist(a6)    ;blank grid
  511.         move.l    a1,irt_itext(a6)
  512.         move.w    d0,irt_count(a6)
  513.  
  514.         bsr    LinkInfoText
  515.         bsr    ShowInfoReq
  516.  
  517. CCL_02        rts
  518.  
  519.  
  520. * If we reach here, then there is a valid grid. If there is already a
  521. * clue list, warn the user that it'll be scrapped by the new one.
  522. * Ask user if this is wanted.
  523.  
  524.  
  525. CCL_01        move.l    clue_list(a6),d0    ;does it exist?
  526.         beq.s    CCL_X        ;no it doesn't so do it now
  527.  
  528.         move.l    d0,a0        ;pointer to it
  529.  
  530.         tst.l    clh_AcList(a0)    ;Across list exists?
  531.         bne.s    CCL_Y        ;skip if it does
  532.  
  533.         tst.l    clh_DnList(a0)    ;Down List exists?
  534.         beq.s    CCL_X        ;skip if it doesn't
  535.  
  536. CCL_Y        lea    KCListW(pc),a0    ;pop up a QueryReq if a
  537.         lea    QRT_1(pc),a1    ;clue list exists
  538.         moveq    #4,d0        ;to warn user
  539.  
  540.         move.l    a0,irt_tlist(a6)
  541.         move.l    a1,irt_itext(a6)
  542.         move.w    d0,irt_count(a6)
  543.  
  544.         bsr    DoQueryReq
  545.  
  546.         btst    #6,applic_flag2(a6)    ;YES gadget hit?
  547.         bne.s    CCL_X            ;continue if so
  548.  
  549.         rts                ;else done
  550.  
  551.  
  552. * Come down here only if user REALLY wants to create a new
  553. * clue list. Scrap the old one & replace with a pristine newq
  554. * one.
  555.  
  556.  
  557. CCL_X        bclr    #4,applic_flag1(a6)    ;clear exists flag
  558.  
  559.         bsr    DisposeClueList    ;ensure that none exists
  560.  
  561.         bsr    FreeText        ;ensure this also
  562.  
  563. CCL_Doit        bsr    HangPointer    ;Tell user to wait
  564.  
  565.         lea    DoingClues(pc),a0
  566.         lea    IRT_1(pc),a1
  567.         moveq    #5,d0
  568.  
  569.         move.l    a0,irt_tlist(a6)    ;pop up InfoReq to tell
  570.         move.l    a1,irt_itext(a6)    ;user that clue list
  571.         move.w    d0,irt_count(a6)    ;now exists
  572.  
  573.         bsr    LinkInfoText
  574.         bsr    ShowInfoReq
  575.  
  576.         bsr    NewClueList    ;create clue list entries
  577.         tst.l    d0        ;successful?
  578.         beq.s    CCL_1        ;no, so exit
  579.  
  580.         bsr    AllocText    ;create clue text buffer
  581.         tst.l    d0        ;successful?
  582.         beq.s    CCL_2        ;no, so exit
  583.  
  584.         bsr    MainPointer    ;recover main pointer
  585.  
  586.         bset    #4,applic_flag1(a6)    ;& set exists flag
  587.  
  588.         rts
  589.  
  590.  
  591. * Arrive here if any allocation failed.
  592.  
  593.  
  594. CCL_2        bsr    FreeText        ;scrap any existing cluetexts
  595.  
  596. CCL_1        bsr    DisposeClueList    ;scrap existing cluelists
  597.  
  598.         bsr    MainPointer    ;tell user all's OK again
  599.  
  600.         rts
  601.  
  602.  
  603. * StrLen(a0) -> d0
  604. * a0 = ptr to string
  605.  
  606. * returns length of an ASCIIZ string in d0
  607.  
  608. * no other registers corrupt !
  609.  
  610.  
  611. StrLen        move.l    a0,-(sp)        ;save ptr
  612.         moveq    #0,d0        ;no of chars initially=0
  613.  
  614. StrL1        tst.b    (a0)+        ;this char EOS?
  615.         beq.s    StrL2        ;skip if so
  616.         addq.w    #1,d0        ;else update string length
  617.         bra.s    StrL1        ;and back for more
  618.  
  619. StrL2        move.l    (sp)+,a0        ;recover ptr
  620.         rts            ;done!
  621.  
  622.  
  623. * ReOrderText(a6)
  624. * a6 = ptr to main program variables
  625.  
  626. * Re-order the text strings within the text space following
  627. * a deletion of a clue text, and update the clue list details.
  628.  
  629. * d0-d2/a0-a2 corrupt
  630.  
  631.  
  632. ReOrderText    move.l    clue_thisone(a6),d0    ;get current string ptr
  633.         beq    ROT_b3            ;doesn't exist-skip
  634.         move.l    d0,a0
  635.  
  636.         bsr.s    StrLen            ;how long is it?
  637.         addq.w    #1,d0            ;including the EOS
  638.         move.w    d0,clue_editlen(a6)    ;and save it
  639.  
  640.         move.l    clue_endptr(a6),a1    ;ptr to end of texts
  641.  
  642.         move.l    a0,a2            ;a0 = ptr to dst
  643.         add.w    d0,a2            ;a2 = ptr to src
  644.  
  645. ROT_l1        move.b    (a2)+,(a0)+        ;copy strings
  646.         cmp.l    a1,a0            ;done them all?
  647.         bls.s    ROT_l1            ;back if not
  648.  
  649.         sub.w    d0,a1
  650.         move.l    a1,clue_endptr(a6)    ;new end of texts
  651.  
  652.         move.l    clue_thisone(a6),a1    ;ptr to current string
  653.  
  654.         move.l    clue_list(a6),a0
  655.         move.l    clh_AcList(a0),d0        ;get ptr to Across list
  656.         beq.s    ROT_b1            ;woops! doesn't exist!
  657.  
  658.         move.w    clh_AcCount(a0),d1    ;no. to check
  659.         move.l    d0,a0            ;copy pointer
  660.         move.w    clue_editlen(a6),d0    ;and amount to move
  661.  
  662. ROT_l2        move.l    cle_Text(a0),d2        ;check text ptr
  663.         beq.s    ROT_b2            ;doesn't exit-get next
  664.  
  665.         cmp.l    a1,d2            ;before moved texts?
  666.         bcs.s    ROT_b2            ;yes, so skip
  667.         bne.s    ROT_b2a            ;after, so change
  668.  
  669.         clr.l    cle_Text(a0)        ;kill ptr if equal
  670.         bra.s    ROT_b2
  671.  
  672. ROT_b2a        move.l    d2,a2
  673.         sub.w    d0,a2            ;else reorder
  674.         move.l    a2,cle_Text(a0)        ;and replace
  675.  
  676. ROT_b2        add.w    #cle_sizeof,a0        ;next clue list entry
  677.         subq.w    #1,d1            ;done them all?
  678.         bne.s    ROT_l2            ;skip back if not
  679.  
  680. ROT_b1        move.l    clue_list(a6),a0
  681.         move.l    clh_DnList(a0),d0        ;get ptr to Down list
  682.         beq.s    ROT_b3            ;woops! doesn't exist!
  683.  
  684.         move.w    clh_DnCount(a0),d1    ;no. to check
  685.         move.l    d0,a0            ;copy pointer
  686.         move.w    clue_editlen(a6),d0    ;and amount to move
  687.  
  688. ROT_l3        move.l    cle_Text(a0),d2        ;check text ptr
  689.         beq.s    ROT_b4            ;doesn't exit-get next
  690.  
  691.         cmp.l    a1,d2            ;before moved texts?
  692.         bcs.s    ROT_b4            ;yes, so skip
  693.         bne.s    ROT_b4a            ;after, so change
  694.  
  695.         clr.l    cle_Text(a0)        ;kill ptr if equal
  696.         bra.s    ROT_b4
  697.  
  698. ROT_b4a        move.l    d2,a2
  699.         sub.w    d0,a2            ;else reorder
  700.         move.l    a2,cle_Text(a0)        ;and replace
  701.  
  702. ROT_b4        add.w    #cle_sizeof,a0        ;next clue list entry
  703.         subq.w    #1,d1            ;done them all?
  704.         bne.s    ROT_l3            ;skip back if not
  705.  
  706.  
  707. * Now, clear clue_thisone to prevent an unwanted repeat reordering
  708. * (which won't be needed unless user selects clue rubout)
  709.  
  710.  
  711. ROT_b3        clr.l    clue_thisone(a6)
  712.         
  713.         rts
  714.  
  715.  
  716. * PickClue(a6)
  717. * a6 = ptr to main program variables
  718.  
  719. * Pop up "Pick Clue" requester, then set P flag
  720. * to alter mouse button function.
  721.  
  722.  
  723. PickClue        lea    Pick_Info(pc),a0
  724.         lea    IRT_1(pc),a1
  725.         moveq    #6,d0
  726.         move.l    a0,irt_tlist(a6)
  727.         move.l    a1,irt_itext(a6)
  728.         move.w    d0,irt_count(a6)
  729.  
  730.         bsr    LinkInfoText
  731.  
  732.         bsr    ShowInfoReq        ;pop up requester
  733.  
  734.         bset    #3,applic_flag1(a6)    ;set Picking flag
  735.  
  736.         rts
  737.  
  738.  
  739. * WhichClue(a6)
  740. * a6 = ptr to main program variables
  741.  
  742. * Find which clue is being selected in both across and
  743. * down lists.
  744.  
  745. * d0-d3/d7/a0-a2 corrupt
  746.  
  747.  
  748. WhichClue    moveq    #0,d0            ;initially picked clue
  749.  
  750.         move.w    d0,pick_across(a6)
  751.         move.w    d0,pick_down(a6)
  752.  
  753.         move.w    pick_hpos(a6),d0        ;picked clue square
  754.         move.w    pick_vpos(a6),d1        ;position
  755.  
  756.         move.l    clue_list(a6),a0        ;ptr to clue list
  757.  
  758.         btst    #6,applic_flag1(a6)    ;which crossword type?
  759.         bne    WCH_10            ;skip if type 2
  760.  
  761.  
  762. * First, try an across clue. If match found, then store and continue.
  763. * First try to force the square pos to the start of an across clue if
  764. * it is one.
  765.  
  766.  
  767. WCH_1        move.w    d1,d2        ;create offset to square
  768.         subq.w    #1,d2
  769.         mulu    grid_across(a6),d2
  770.         move.l    d2,a2
  771.  
  772.         move.w    d0,d2
  773.         subq.w    #1,d2
  774.         add.w    d2,a2        ;this is offset in words
  775.         add.l    a2,a2        ;and this is it in bytes!
  776.  
  777.         add.l    grid_array(a6),a2    ;ptr to square
  778.  
  779.         move.w    d0,d2        ;copy horiz pos
  780.  
  781.         cmp.w    #1,d0        ;already at LHS edge?
  782.         beq.s    WCH_2        ;skip if so
  783.         
  784. WCH_3        tst.b    -1(a2)        ;prev square black?
  785.         beq.s    WCH_2        ;stuck with this if so
  786.  
  787.         subq.l    #2,a2        ;point to prev
  788.         subq.w    #1,d2        ;prev horiz pos
  789.         cmp.w    #1,d2        ;hit LHS?
  790.         bne.s    WCH_3        ;back if not
  791.  
  792.  
  793. * Here, either hit start of across clue, LHS, or it's a down clue.
  794.  
  795.  
  796. WCH_2        cmp.w    d2,d0        ;moved at all?
  797.         bne.s    WCH_4        ;yes, so true across clue
  798.  
  799.         cmp.w    grid_across(a6),d2    ;RHS edge?
  800.         beq.s    WCH_5            ;not across clue!
  801.  
  802.         tst.b    3(a2)        ;next square white?
  803.         beq.s    WCH_5        ;no, so not across clue
  804.  
  805.  
  806. * Here, it's a true across clue. If so, save square position
  807. * and begin scanning across list for clue number.
  808. * Here d0/d1 should point to a valid square for comparison.
  809.  
  810.  
  811. WCH_4        move.l    clh_AcList(a0),a1        ;ptr to list
  812.         move.w    clh_AcCount(a0),d7    ;no to scan
  813.  
  814. WCH_L1        cmp.w    cle_AcSq(a1),d2        ;match horiz pos?
  815.         bne.s    WCH_B1            ;no
  816.         cmp.w    cle_DnSq(a1),d1        ;match vert pos?
  817.         bne.s    WCH_B1            ;no
  818.  
  819.         move.w    cle_Num(a1),pick_across(a6)
  820.         move.l    a1,clue_AcEntry(a6)    ;save ptr to list entry
  821.  
  822.         move.w    d2,pick_Ach(a6)        ;else set up the
  823.         move.w    d1,pick_Acv(a6)        ;clue information
  824.         bra.s    WCH_5            ;and continue on
  825.  
  826. WCH_B1        add.w    #cle_sizeof,a1        ;next clue list entry
  827.         subq.w    #1,d7            ;done them all?
  828.         bne.s    WCH_L1            ;back if not
  829.  
  830.  
  831. * Here, try a down clue.
  832.  
  833.  
  834. WCH_5        move.w    grid_across(a6),d3
  835.  
  836.         add.w    d3,d3    ;amount to subtract for next down
  837.  
  838.         neg.w    d3    ;for convenience
  839.  
  840.         move.w    d1,d2    ;create offset to square
  841.         subq.w    #1,d2
  842.         mulu    grid_across(a6),d2
  843.         move.l    d2,a2
  844.  
  845.         move.w    d0,d2
  846.         subq.w    #1,d2
  847.         add.w    d2,a2    ;this is offset in words
  848.         add.l    a2,a2    ;and this is it in bytes!
  849.  
  850.         add.l    grid_array(a6),a2        ;ptr to square
  851.  
  852.         move.w    d1,d2    ;copy vert pos
  853.  
  854.         cmp.w    #1,d1    ;already at top edge?
  855.         beq.s    WCH_6    ;skip if so
  856.  
  857. WCH_7        tst.b    1(a2,d3.w)    ;prev square black?
  858.         beq.s    WCH_6        ;stuck with this if so
  859.  
  860.         add.w    d3,a2        ;point to prev (address add!)
  861.         subq.w    #1,d2        ;prev vert pos
  862.         cmp.w    #1,d2        ;hit top?
  863.         bne.s    WCH_7        ;back if not
  864.  
  865.  
  866. * Here, either hit start of down clue, or top.
  867.  
  868.  
  869. WCH_6        cmp.w    d2,d1        ;moved at all?
  870.         bne.s    WCH_8        ;yes, so true down clue
  871.  
  872.         cmp.w    grid_down(a6),d2    ;bottom edge?
  873.         beq.s    WCH_9        ;not down clue!
  874.  
  875.         neg.w    d3        ;positive offset once more
  876.         tst.b    1(a2,d3.w)    ;next square white?
  877.         beq.s    WCH_9        ;no, so not down clue
  878.  
  879.  
  880. * Here, it's a true down clue. If so, save square position
  881. * and begin scanning down list for clue number.
  882.  
  883.  
  884. WCH_8        move.l    clh_DnList(a0),a1        ;ptr to list
  885.         move.w    clh_DnCount(a0),d7    ;no to scan
  886.  
  887. WCH_L2        cmp.w    cle_AcSq(a1),d0        ;match horiz pos?
  888.         bne.s    WCH_B2            ;no
  889.         cmp.w    cle_DnSq(a1),d2        ;match vert pos?
  890.         bne.s    WCH_B2            ;no
  891.  
  892.         move.w    cle_Num(a1),pick_down(a6)
  893.         move.l    a1,clue_DnEntry(a6)    ;save ptr to list entry
  894.  
  895.         move.w    d0,pick_Dnh(a6)        ;else set up the
  896.         move.w    d2,pick_Dnv(a6)        ;clue information
  897.         bra.s    WCH_9            ;and continue on
  898.  
  899. WCH_B2        add.w    #cle_sizeof,a1        ;next clue list entry
  900.         subq.w    #1,d7            ;done them all?
  901.         bne.s    WCH_L2            ;back if not
  902.  
  903.  
  904. * Now true across/down clues found, and details saved. Bye!!
  905.  
  906.  
  907. WCH_9        rts
  908.  
  909.  
  910. * Here, do the same for Type 2 crossword. First, try an across clue.
  911.  
  912.  
  913. WCH_10        move.w    d1,d2        ;create offset to square
  914.         subq.w    #1,d2
  915.         mulu    grid_across(a6),d2
  916.         move.l    d2,a2
  917.  
  918.         move.w    d0,d2
  919.         subq.w    #1,d2
  920.         add.w    d2,a2        ;this is offset in words
  921.         add.l    a2,a2        ;and this is it in bytes!
  922.  
  923.         add.l    grid_array(a6),a2    ;ptr to square
  924.  
  925.         move.w    d0,d2        ;copy horiz pos
  926.  
  927.         cmp.w    #1,d0        ;already at LHS edge?
  928.         beq.s    WCH_S1        ;skip if so
  929.  
  930.  
  931. WCH_12        btst    #0,-2(a2)    ;prev square vert barred?
  932.         bne.s    WCH_13        ;skip if so
  933.  
  934.         subq.l    #2,a2        ;point to prev
  935.         subq.w    #1,d2        ;prev horiz pos
  936.         cmp.w    #1,d2        ;hit LHS?
  937.         bne.s    WCH_12        ;back if not.
  938.  
  939.  
  940. * Here either hit start of across clue, LHS, or it's a down clue.
  941.  
  942.  
  943. WCH_13        cmp.w    d2,d0        ;moved at all?
  944.         bne.s    WCH_14        ;yes, so true across clue
  945.  
  946.         cmp.w    grid_across(a6),d2    ;RHS edge?
  947.         beq.s    WCH_15            ;yes, so not across clue
  948.  
  949. WCH_S1        btst    #0,(a2)        ;this square vert barred?
  950.         bne.s    WCH_15        ;yes, so not across clue
  951.  
  952.         
  953. * Here it's a true across clue, so store the details.
  954.  
  955.  
  956. WCH_14        move.l    clh_AcList(a0),a1        ;ptr to list
  957.         move.w    clh_AcCount(a0),d7    ;no to scan
  958.  
  959. WCH_L3        cmp.w    cle_AcSq(a1),d2        ;match horiz pos?
  960.         bne.s    WCH_B3            ;no
  961.         cmp.w    cle_DnSq(a1),d1        ;match vert pos?
  962.         bne.s    WCH_B3            ;no
  963.  
  964.         move.w    cle_Num(a1),pick_across(a6)
  965.         move.l    a1,clue_AcEntry(a6)    ;save ptr to list entry
  966.  
  967.         move.w    d2,pick_Ach(a6)        ;else set up the
  968.         move.w    d1,pick_Acv(a6)        ;clue information
  969.         bra.s    WCH_15            ;and continue on
  970.  
  971. WCH_B3        add.w    #cle_sizeof,a1        ;next clue list entry
  972.         subq.w    #1,d7            ;done them all?
  973.         bne.s    WCH_L3            ;back if not
  974.  
  975.  
  976. * Here, try a down clue.
  977.  
  978.  
  979. WCH_15        move.w    d1,d2        ;else create offset to square
  980.         subq.w    #1,d2
  981.         mulu    grid_across(a6),d2
  982.         move.l    d2,a2
  983.  
  984.         move.w    d0,d2
  985.         subq.w    #1,d2
  986.         add.w    d2,a2        ;this is offset in words
  987.         add.l    a2,a2        ;and this is it in bytes!
  988.  
  989.         add.l    grid_array(a6),a2    ;ptr to square
  990.  
  991.         move.w    grid_across(a6),d3
  992.  
  993.         add.w    d3,d3    ;amount to subtract for next down
  994.         neg.w    d3    ;neg it for convenience (see below)
  995.  
  996.         move.w    d1,d2        ;copy vert pos
  997.  
  998.         cmp.w    #1,d1        ;already at top edge?
  999.         beq.s    WCH_S2        ;skip if so
  1000.  
  1001. WCH_17        btst    #1,0(a2,d3.w)    ;prev square horiz barred?
  1002.         bne.s    WCH_16        ;skip if so
  1003.  
  1004.         add.w    d3,a2        ;point to prev
  1005.         subq.w    #1,d2        ;prev vert pos
  1006.         cmp.w    #1,d2        ;hit top?
  1007.         bne.s    WCH_17        ;back if not.
  1008.  
  1009.  
  1010. * Here either hit start of down clue, or top of grid.
  1011.  
  1012.  
  1013. WCH_16        cmp.w    d2,d1        ;moved at all?
  1014.         bne.s    WCH_18        ;yes, so true down clue
  1015.  
  1016.         cmp.w    grid_down(a6),d2    ;bottom edge?
  1017.         beq.s    WCH_19        ;yes, so not down clue
  1018.  
  1019. WCH_S2        btst    #1,(a2)        ;this square horiz barred?
  1020.         bne.s    WCH_19        ;yes, so not down clue
  1021.         
  1022.  
  1023. * Here it's a true down clue, so store the details.
  1024.  
  1025.  
  1026. WCH_18        move.l    clh_DnList(a0),a1        ;ptr to list
  1027.         move.w    clh_DnCount(a0),d7    ;no to scan
  1028.  
  1029. WCH_L4        cmp.w    cle_AcSq(a1),d0        ;match horiz pos?
  1030.         bne.s    WCH_B4            ;no
  1031.         cmp.w    cle_DnSq(a1),d2        ;match vert pos?
  1032.         bne.s    WCH_B4            ;no
  1033.  
  1034.         move.w    cle_Num(a1),pick_down(a6)
  1035.         move.l    a1,clue_DnEntry(a6)    ;save ptr to list entry
  1036.  
  1037.         move.w    d0,pick_Dnh(a6)        ;else set up the
  1038.         move.w    d2,pick_Dnv(a6)        ;clue information
  1039.         bra.s    WCH_19            ;and continue on
  1040.  
  1041. WCH_B4        add.w    #cle_sizeof,a1        ;next clue list entry
  1042.         subq.w    #1,d7            ;done them all?
  1043.         bne.s    WCH_L4            ;back if not
  1044.  
  1045.  
  1046. * Now true across/down clues found, and details saved. Bye!!
  1047.  
  1048.  
  1049. WCH_19        rts
  1050.  
  1051.  
  1052. * GetClueText(a0,d0,d1) -> a0,d0
  1053.  
  1054. * a0 = ptr to clue list header
  1055. * d0 = clue number
  1056. * d1 = 0 for across clue, 1 for down clue
  1057.  
  1058. * Scan clue lists & return ptr to clue text.
  1059.  
  1060. * Returns:
  1061.  
  1062. * a0 = ptr to clue text, or NULL if no clue text coupled to
  1063. *    this clue
  1064.  
  1065. * d0 =   0 if valid clue text ptr,
  1066. *    1 if clue not in list
  1067. *    2 if no valid list
  1068.  
  1069.  
  1070. * d2/a1 corrupt
  1071.  
  1072.  
  1073. GetClueText    tst.b    d1        ;across or down?
  1074.         bne.s    GCT_1        ;skip if down clue wanted
  1075.  
  1076.         move.l    clh_AcList(a0),d2    ;check clue list
  1077.         beq.s    GCT_Error    ;woops! doesn't exist
  1078.  
  1079.         move.l    d2,a1            ;ptr to Across list
  1080.         move.w    clh_AcCount(a0),d3    ;no of clues
  1081.  
  1082. GCT_2        cmp.w    (a1),d0        ;found it?
  1083.         beq.s    GCT_3        ;skip if so
  1084.  
  1085.         add.w    #cle_sizeof,a1    ;else point to next entry
  1086.         subq.w    #1,d3        ;scanned entire list?
  1087.         bne.s    GCT_2        ;no, back for more
  1088.  
  1089.         sub.l    a0,a0        ;haven't found it, so
  1090.         moveq    #1,d0        ;clue not in list
  1091.         rts
  1092.  
  1093. GCT_3        move.l    cle_Text(a1),a0    ;else get text pointer
  1094.         move.l    a0,d0        ;NULL pointer?
  1095.         bne.s    GCT_Done        ;skip if not
  1096.  
  1097.         moveq    #1,d0        ;else signal fact
  1098.         rts
  1099.  
  1100.  
  1101. * Here, it's a down clue. Go get it if it's there...
  1102.  
  1103.  
  1104. GCT_1        move.l    clh_DnList(a0),d2    ;check clue list
  1105.         beq.s    GCT_Error    ;woops! doesn't exist
  1106.  
  1107.         move.l    d2,a1            ;ptr to Down list
  1108.         move.w    clh_DnCount(a0),d3    ;no of clues
  1109.  
  1110. GCT_4        cmp.w    (a1),d0        ;found it?
  1111.         beq.s    GCT_5        ;skip if so
  1112.  
  1113.         add.w    #cle_sizeof,a1    ;else point to next entry
  1114.         subq.w    #1,d3        ;scanned entire list?
  1115.         bne.s    GCT_4        ;no, back for more
  1116.  
  1117.         sub.l    a0,a0        ;haven't found it, so
  1118.         moveq    #1,d0        ;clue not in list
  1119.         rts
  1120.  
  1121. GCT_5        move.l    cle_Text(a1),a0    ;else get text pointer
  1122.         move.l    a0,d0        ;NULL pointer?
  1123.         bne.s    GCT_Done        ;skip if not
  1124.  
  1125.         moveq    #1,d0        ;else signal fact
  1126.         rts
  1127.  
  1128.  
  1129. GCT_Done        moveq    #0,d0        ;signal valid clue list
  1130.         rts
  1131.  
  1132. GCT_Error    moveq    #2,d0        ;cock up
  1133.         rts
  1134.  
  1135.  
  1136. * SetClueText(a0,a1,d0,d1) -> d0
  1137.  
  1138. * a0 = ptr to clue list header
  1139. * a1 = ptr to text to set
  1140. * d0 = clue number
  1141. * d1 = 0 for across clue, 1 for down clue
  1142.  
  1143. * Set text pointer for clue specified in arguments.
  1144.  
  1145. * Returns:
  1146.  
  1147. * d0 =   0 if valid clue list & clue exists
  1148. *    1 if clue not in list
  1149. *    2 if no valid list
  1150.  
  1151. * Note:if text pointed to by a1 is a null string, then the
  1152. * pointer is converted to NULL prior to being set into the
  1153. * clue list entry!
  1154.  
  1155.  
  1156. * d2/a1-a2 corrupt
  1157.  
  1158.  
  1159. SetClueText    tst.b    (a1)        ;null string?
  1160.         bne.s    SCT_ok        ;no
  1161.  
  1162.         sub.l    a1,a1        ;else make null pointer!
  1163.  
  1164. SCT_ok        tst.b    d1        ;across or down?
  1165.         bne.s    SCT_1        ;skip if down clue wanted
  1166.  
  1167.         move.l    clh_AcList(a0),d2    ;check clue list
  1168.         beq.s    SCT_Error    ;woops! doesn't exist
  1169.  
  1170.         move.l    d2,a2            ;ptr to Across list
  1171.         move.w    clh_AcCount(a0),d3    ;no of clues
  1172.  
  1173. SCT_2        cmp.w    (a2),d0        ;found it?
  1174.         beq.s    SCT_3        ;skip if so
  1175.  
  1176.         add.w    #cle_sizeof,a2    ;else point to next entry
  1177.         subq.w    #1,d3        ;scanned entire list?
  1178.         bne.s    SCT_2        ;no, back for more
  1179.  
  1180.         moveq    #1,d0        ;clue not in list
  1181.         rts
  1182.  
  1183. SCT_3        move.l    a1,cle_Text(a2)    ;else get text pointer
  1184.         bra.s    SCT_Done
  1185.  
  1186.  
  1187. * Here, it's a down clue. Go get it if it's there...
  1188.  
  1189.  
  1190. SCT_1        move.l    clh_DnList(a0),d2    ;check clue list
  1191.         beq.s    SCT_Error    ;woops! doesn't exist
  1192.  
  1193.         move.l    d2,a2            ;ptr to Down list
  1194.         move.w    clh_DnCount(a0),d3    ;no of clues
  1195.  
  1196. SCT_4        cmp.w    (a2),d0        ;found it?
  1197.         beq.s    SCT_5        ;skip if so
  1198.  
  1199.         add.w    #cle_sizeof,a2    ;else point to next entry
  1200.         subq.w    #1,d3        ;scanned entire list?
  1201.         bne.s    SCT_4        ;no, back for more
  1202.  
  1203.         moveq    #1,d0        ;clue not in list
  1204.         rts
  1205.  
  1206. SCT_5        move.l    a1,cle_Text(a2)    ;else get text pointer
  1207.  
  1208. SCT_Done        moveq    #0,d0        ;signal valid clue list
  1209.         rts
  1210.  
  1211. SCT_Error    moveq    #2,d0        ;cock up
  1212.         rts
  1213.  
  1214.  
  1215. * GetNewText() -> a0,CCR
  1216. * obtain ptr to text buffer for the string gadget
  1217.  
  1218. * Returns ptr to text in a0
  1219. * also, Z flag of CCR set if text is a null string,
  1220. * cleared otherwise.
  1221.  
  1222. * a0 only affected
  1223.  
  1224.  
  1225. GetNewText    lea    GetClue(pc),a0
  1226.         move.l    gg_SpecialInfo(a0),a0
  1227.         move.l    si_Buffer(a0),a0
  1228.         tst.b    (a0)
  1229.         rts
  1230.  
  1231.  
  1232. * SetReqText(a1)
  1233. * a1 = ptr to text to copy into req string gadget buffer
  1234.  
  1235. * a0-a1 corrupt
  1236.  
  1237.  
  1238. SetReqText    lea    GetClue(pc),a0
  1239.         move.l    gg_SpecialInfo(a0),a0
  1240.         clr.w    si_BufferPos(a0)
  1241.         move.l    si_Buffer(a0),a0
  1242.  
  1243.         move.l    a1,d0        ;NULL pointer?
  1244.         beq.s    SRT_B1        ;skip if so
  1245.  
  1246. SRT_L1        move.b    (a1)+,(a0)+    ;else copy text across
  1247.         bne.s    SRT_L1
  1248.  
  1249.         rts
  1250.  
  1251. SRT_B1        clr.b    (a0)        ;else set null string
  1252.         rts
  1253.  
  1254.  
  1255. * EditClue(a6)
  1256. * a6 = ptr to main program variables
  1257.  
  1258. * Pick clue to edit text for, then pop up another
  1259. * requester with the string gadget for the text.
  1260.  
  1261.  
  1262. * ALL REGISTERS CORRUPT
  1263.  
  1264.  
  1265. EditClue        btst    #1,applic_flag2(a6)    ;HELP on?
  1266.         beq.s    ECL_Doit            ;skip if not
  1267.  
  1268.         lea    Help_AC(pc),a0    ;else pop up
  1269.         moveq    #4,d0        ;help box
  1270.         bsr    _PopUpQR
  1271.  
  1272.         beq    ECL_Done
  1273.  
  1274. ECL_Doit        btst    #4,applic_flag1(a6)    ;clue list exists?
  1275.         bne.s    ECL_OK            ;skip if so
  1276.  
  1277.         lea    NoClues(pc),a0
  1278.         lea    QRT_1(pc),a1
  1279.         moveq    #5,d0
  1280.  
  1281.         move.l    a0,irt_tlist(a6)    ;inform user that a clue
  1282.         move.l    a1,irt_itext(a6)    ;list is needed & ask if
  1283.         move.w    d0,irt_count(a6)    ;user wants to build one
  1284.  
  1285.         bsr    DoQueryReq
  1286.  
  1287.         btst    #6,applic_flag2(a6)    ;YES gadget hit?
  1288.         beq    ECL_Done            ;skip if not
  1289.  
  1290.         bsr    CCL_00            ;create clue list
  1291.  
  1292.         btst    #4,applic_flag1(a6)    ;got it?
  1293.         beq    ECL_Done            ;exit if not
  1294.  
  1295.  
  1296. * If we reach here, then we've got a clue list and we can add to it.
  1297. * Get clue to add to it from user.
  1298.  
  1299.  
  1300. ECL_OK        bsr    PickClue        ;see above
  1301.  
  1302.  
  1303. * Now handle mouse events here, until a clue has been picked.
  1304. * Temporarily restrict IDCMP to MOUSEMOVE/MOUSEBUTTONS and the
  1305. * gadget selection IDCMPs only (latter to allow grid to be
  1306. * scrolled to find clue to solve etc!).
  1307. * Then recover the normal IDCMP at the end.
  1308.  
  1309.  
  1310.         move.l    mw_handle(a6),a0
  1311.         move.l    #MOUSEMOVE+MOUSEBUTTONS,d0
  1312.         add.l    #GADGETDOWN+GADGETUP,d0
  1313.  
  1314.         CALLINT    ModifyIDCMP
  1315.  
  1316. ECL_1        move.l    mw_userport(a6),a0
  1317.         lea    ehb_std(pc),a5
  1318.  
  1319.         bsr    DoEvent        ;completely event driven!
  1320.  
  1321.         btst    #3,applic_flag1(a6)    ;picked a clue?
  1322.         bne.s    ECL_1            ;loop until done
  1323.  
  1324.         move.l    grid_array(a6),a0
  1325.         add.l    grid_offset(a6),a0    ;point to square data
  1326.         move.w    (a0),d0            ;get square data
  1327.         tst.b    d0            ;check if white square
  1328.         bne.s    ECL_1a            ;and continue if OK
  1329.  
  1330.         lea    BlackIsNoNo(pc),a0
  1331.         lea    IRT_1(pc),a1
  1332.         moveq    #3,d0
  1333.  
  1334.         move.l    a0,irt_tlist(a6)    ;inform user that a
  1335.         move.l    a1,irt_itext(a6)    ;white square MUST
  1336.         move.w    d0,irt_count(a6)    ;be selected!
  1337.  
  1338.         bsr    LinkInfoText
  1339.         bsr    ShowInfoReq
  1340.  
  1341.         rts
  1342.  
  1343. ECL_1a        bsr    WhichClue    ;find which clue picked
  1344.  
  1345.  
  1346. * Here, check if across clue picked. If not, skip this section.
  1347. * If yes, pop up QueryRequester. If user responds by hitting the
  1348. * "YES" gadget, edit the clue, else skip to checking down clue.
  1349.  
  1350.  
  1351.         move.w    pick_across(a6),d0    ;any across clue?
  1352.         beq    ECL_2            ;no
  1353.  
  1354.         tst.w    pick_down(a6)        ;any down clue?
  1355.         beq.s    ECL_Z1            ;skip if not
  1356.  
  1357.         lea    QRT_1(pc),a0
  1358.         lea    EAC_YN(pc),a1
  1359.         moveq    #3,d0
  1360.  
  1361.         move.l    a0,irt_itext(a6)        ;else pop up a
  1362.         move.l    a1,irt_tlist(a6)        ;QueryReq
  1363.         move.w    d0,irt_count(a6)
  1364.  
  1365.         bsr    DoQueryReq
  1366.  
  1367.         btst    #6,applic_flag2(a6)    ;"YES" gadget hit?
  1368.         beq    ECL_2            ;skip if not
  1369.  
  1370.  
  1371. * Now initialise rhb_ structure for HandleRequest() for each
  1372. * call (there'll be 2 for any picked square linked to both an
  1373. * across and a down clue).
  1374.  
  1375.  
  1376. ECL_Z1        move.l    ThisReq(a6),a4
  1377.  
  1378.         move.l    mw_handle(a6),rhb_Window(a4)
  1379.         move.l    mw_userport(a6),rhb_UserPort(a4)
  1380.         move.l    mw_IDCMP(a6),rhb_IDCMP(a4)
  1381.         lea    EdClueReq(pc),a0
  1382.         move.l    a0,rhb_Requester(a4)
  1383.  
  1384. ;        clr.l    rhb_PreCode(a4)
  1385.  
  1386.         lea    ReadyToEdit(pc),a0    ;see below
  1387.         move.l    a0,rhb_PreCode(a4)
  1388.  
  1389.         move.l    clue_list(a6),a0
  1390.         moveq    #0,d1            ;across clue
  1391.         bsr    GetClueText        ;get text ptr
  1392.         cmp.w    #2,d0            ;error?
  1393.         beq.s    ECL_2            ;skip if so
  1394.  
  1395.         move.l    a0,clue_thisone(a6)    ;save text ptr
  1396.  
  1397.         move.l    a0,a1        ;if a clue text exists then
  1398.         bsr    SetReqText    ;pop into the string gadget
  1399.  
  1400.         bsr    TXAcross
  1401.  
  1402.         bsr    HandleRequest
  1403.  
  1404.         bsr    ReOrderText        ;shuffle the text list
  1405.  
  1406.         bsr    GetNewText        ;get gadget text
  1407.  
  1408. ;        move.w    CCR,d7            ;save flags for now
  1409.  
  1410.         CALLEXEC    GetCC            ;get flags
  1411.         move.w    d0,d7            ;save them
  1412.  
  1413.         move.l    a0,d6            ;save text ptr
  1414.  
  1415.         move.l    clue_endptr(a6),a1    ;will be true text ptr
  1416.         move.b    (a0),(a1)        ;copy 1st char of string
  1417.         move.l    clue_list(a6),a0
  1418.         move.w    pick_across(a6),d0
  1419.         moveq    #0,d1            ;across clue
  1420.         bsr    SetClueText        ;set text ptr
  1421.  
  1422.         move.w    d7,CCR            ;text ptr NULL?
  1423.         beq.s    ECL_2            ;skip if so
  1424.  
  1425.         move.l    clue_endptr(a6),a0    ;else append text to list
  1426.         move.l    d6,a1            ;this text!
  1427.  
  1428. ECL_C1        move.b    (a1)+,(a0)+        ;copy text
  1429.         bne.s    ECL_C1
  1430.  
  1431.         move.l    a0,clue_endptr(a6)    ;new end of texts
  1432.  
  1433.  
  1434. * Here, check if down clue picked. If not, skip this section.
  1435. * If yes, pop up QueryRequester. If user responds by hitting the
  1436. * "YES" gadget, edit the clue, else skip to checking down clue.
  1437.  
  1438.  
  1439. ECL_2        move.w    pick_down(a6),d0        ;any down clue?
  1440.         beq    ECL_Done            ;no
  1441.  
  1442.         tst.w    pick_across(a6)        ;any across clue?
  1443.         beq.s    ECL_Z2            ;skip if not
  1444.  
  1445.         lea    QRT_1(pc),a0
  1446.         lea    EDC_YN(pc),a1
  1447.         moveq    #3,d0
  1448.  
  1449.         move.l    a0,irt_itext(a6)        ;else pop up a
  1450.         move.l    a1,irt_tlist(a6)        ;QueryReq
  1451.         move.w    d0,irt_count(a6)
  1452.  
  1453.         bsr    DoQueryReq
  1454.  
  1455.         btst    #6,applic_flag2(a6)    ;"YES" gadget hit?
  1456.         beq    ECL_Done            ;skip if not
  1457.  
  1458.  
  1459. * Now initialise rhb_ structure for HandleRequest() for each
  1460. * call (there'll be 2 for any picked square linked to both an
  1461. * across and a down clue).
  1462.  
  1463.  
  1464. ECL_Z2        move.l    ThisReq(a6),a4
  1465.  
  1466.         move.l    mw_handle(a6),rhb_Window(a4)
  1467.         move.l    mw_userport(a6),rhb_UserPort(a4)
  1468.         move.l    mw_IDCMP(a6),rhb_IDCMP(a4)
  1469.         lea    EdClueReq(pc),a0
  1470.         move.l    a0,rhb_Requester(a4)
  1471.  
  1472. ;        clr.l    rhb_PreCode(a4)
  1473.  
  1474.         lea    ReadyToEdit(pc),a0    ;see below
  1475.         move.l    a0,rhb_PreCode(a4)
  1476.  
  1477.         move.l    clue_list(a6),a0
  1478.         moveq    #1,d1            ;down clue
  1479.         bsr    GetClueText        ;get text ptr
  1480.         cmp.w    #2,d0            ;error?
  1481.         beq.s    ECL_Done            ;skip if so
  1482.  
  1483.         move.l    a0,clue_thisone(a6)    ;save text ptr
  1484.  
  1485.         move.l    a0,a1        ;if a clue text exists then
  1486.         bsr    SetReqText    ;pop into the string gadget
  1487.  
  1488.         bsr    TXDown
  1489.  
  1490.         bsr    HandleRequest
  1491.  
  1492.         bsr    ReOrderText        ;shuffle the text list
  1493.  
  1494.         bsr    GetNewText        ;get gadget text
  1495.  
  1496. ;        move.w    CCR,d7            ;save flags for now
  1497.  
  1498.         CALLEXEC    GetCC            ;get flags
  1499.         move.w    d0,d7            ;save them
  1500.  
  1501.         move.l    a0,d6            ;save text ptr
  1502.  
  1503.         move.l    clue_endptr(a6),a1    ;will be true text ptr
  1504.         move.b    (a0),(a1)        ;copy 1st char of string
  1505.         move.l    clue_list(a6),a0
  1506.         move.w    pick_down(a6),d0
  1507.         moveq    #1,d1            ;down clue
  1508.         bsr    SetClueText        ;set text ptr
  1509.  
  1510.         move.w    d7,CCR            ;text ptr NULL?
  1511.         beq.s    ECL_Done            ;skip if so
  1512.  
  1513.         move.l    clue_endptr(a6),a0    ;else append text to list
  1514.         move.l    d6,a1            ;this text!
  1515.  
  1516. ECL_C2        move.b    (a1)+,(a0)+        ;copy text
  1517.         bne.s    ECL_C2
  1518.  
  1519.         move.l    a0,clue_endptr(a6)    ;new end of texts
  1520.  
  1521. ECL_Done        moveq    #-1,d0            ;stop spurious
  1522.         move.w    d0,mp_across(a6)        ;square changing when
  1523.         move.w    d0,mp_down(a6)        ;quitting requester
  1524.  
  1525.         move.l    mw_handle(a6),a0
  1526.         move.l    mw_IDCMP(a6),d0
  1527.  
  1528.         CALLINT    ModifyIDCMP        ;make sure IDCMP back!
  1529.  
  1530.         move.l    mw_handle(a6),a0
  1531.         CALLINT    ActivateWindow
  1532.  
  1533.         rts
  1534.  
  1535.  
  1536. * Precode for above requester...
  1537.  
  1538.  
  1539. * ReadyToEdit(a4)
  1540. * a4 = ptr to initialised requester handler block
  1541.  
  1542. * Activates the string gadget on the Edit Clue requester
  1543. * or at least tries to...
  1544.  
  1545. * a0-a2 corrupt (plus poss. d0-d2 also!)
  1546.  
  1547.  
  1548. ReadyToEdit    lea    GetClue(pc),a0
  1549.         move.l    rhb_Window(a4),a1
  1550.         move.l    rhb_Requester(a4),a2
  1551.  
  1552.         CALLINT    ActivateGadget
  1553.  
  1554.         rts
  1555.  
  1556.  
  1557. * EraseClue(a6)
  1558. * a6 = ptr to main program variables
  1559.  
  1560. * Perform the "Erase Clue Text" function selected
  1561. * via the menu.
  1562.  
  1563. * Assume ALL registers corrupt!
  1564.  
  1565.  
  1566. EraseClue    btst    #1,applic_flag2(a6)    ;HELP on?
  1567.         beq.s    ERL_Doit            ;skip if not
  1568.  
  1569.         lea    Help_RC(pc),a0    ;else pop up a
  1570.         moveq    #4,d0        ;help box
  1571.         bsr    _PopUpQR
  1572.  
  1573.         beq    ERL_B2
  1574.  
  1575. ERL_Doit        btst    #4,applic_flag1(a6)    ;clue list exists?
  1576.         bne.s    ERL_OK            ;skip if so
  1577.  
  1578.         lea    NoClues(pc),a0
  1579.         lea    QRT_1(pc),a1
  1580.         moveq    #5,d0
  1581.  
  1582.         move.l    a0,irt_tlist(a6)    ;else inform user that
  1583.         move.l    a1,irt_itext(a6)    ;a clue list is needed
  1584.         move.w    d0,irt_count(a6)    ;& ask user if one wanted
  1585.  
  1586.         bsr    DoQueryReq
  1587.  
  1588.         btst    #6,applic_flag2(a6)    ;YES gadget hit?
  1589.         beq    ERL_B2            ;exit if not
  1590.  
  1591.         bsr    CCL_00        ;else build clue list
  1592.  
  1593.         rts
  1594.  
  1595. ERL_OK        bsr    PickClue        ;see above
  1596.  
  1597.  
  1598. * Now handle mouse events here, until a clue has been picked.
  1599. * Temporarily restrict IDCMP to MOUSEMOVE/MOUSEBUTTONS and the
  1600. * gadget selection IDCMPs only (latter to allow grid to be
  1601. * scrolled to find clue to solve etc!).
  1602. * Then recover the normal IDCMP at the end.
  1603.  
  1604.  
  1605.         move.l    mw_handle(a6),a0
  1606.         move.l    #MOUSEMOVE+MOUSEBUTTONS,d0
  1607.         add.l    #GADGETDOWN+GADGETUP,d0
  1608.  
  1609.         CALLINT    ModifyIDCMP
  1610.  
  1611. ERL_1        move.l    mw_userport(a6),a0
  1612.         lea    ehb_std(pc),a5
  1613.  
  1614.         bsr    DoEvent        ;completely event driven!
  1615.  
  1616.         btst    #3,applic_flag1(a6)    ;picked a clue?
  1617.         bne.s    ERL_1            ;loop until done
  1618.  
  1619.         move.l    grid_array(a6),a0
  1620.         add.l    grid_offset(a6),a0    ;point to square data
  1621.         move.w    (a0),d0            ;get square data
  1622.         tst.b    d0            ;check if white square
  1623.         bne.s    ERL_1a            ;and continue if OK
  1624.  
  1625.         lea    BlackIsNoNo(pc),a0
  1626.         lea    IRT_1(pc),a1
  1627.         moveq    #3,d0
  1628.  
  1629.         move.l    a0,irt_tlist(a6)    ;inform user that a
  1630.         move.l    a1,irt_itext(a6)    ;white square MUST
  1631.         move.w    d0,irt_count(a6)    ;be selected!
  1632.  
  1633.         bsr    LinkInfoText
  1634.         bsr    ShowInfoReq
  1635.  
  1636.         rts
  1637.  
  1638. ERL_1a        bsr    WhichClue    ;find which clue picked
  1639.  
  1640.  
  1641. * Check if Across clue selected. If not, skip this section.
  1642.  
  1643.  
  1644.         move.w    pick_across(a6),d0    ;got across clue?
  1645.         beq.s    ERL_B1            ;skip if not
  1646.  
  1647.         tst.w    pick_down(a6)        ;down clue also?
  1648.         beq.s    ERL_Z1            ;skip if not
  1649.  
  1650.         lea    QRT_1(pc),a0
  1651.         lea    DAC_YN(pc),a1
  1652.         moveq    #3,d0
  1653.  
  1654.         move.l    a0,irt_itext(a6)    ;else pop up a
  1655.         move.l    a1,irt_tlist(a6)    ;QueryReq
  1656.         move.w    d0,irt_count(a6)
  1657.  
  1658.         bsr    DoQueryReq
  1659.  
  1660.         btst    #6,applic_flag2(a6)    ;"YES" gadget hit?
  1661.         beq.s    ERL_B1            ;skip if not
  1662.  
  1663. ERL_Z1        move.l    clue_list(a6),a0
  1664.         moveq    #0,d1            ;across clue
  1665.         bsr    GetClueText        ;get text ptr
  1666.         cmp.w    #2,d0            ;error?
  1667.         beq.s    ERL_B1            ;skip if so
  1668.  
  1669.         move.l    a0,clue_thisone(a6)    ;save text ptr
  1670.  
  1671.         bsr    ReOrderText        ;shuffle the text list
  1672.  
  1673.  
  1674. * Check if Down clue selected. If not, skip this section.
  1675.  
  1676.  
  1677. ERL_B1        move.w    pick_down(a6),d0    ;down clue?
  1678.         beq.s    ERL_B2        ;skip if not
  1679.  
  1680.         tst.w    pick_across(a6)    ;across clue also?
  1681.         beq.s    ERL_Z2        ;skip if not
  1682.  
  1683.         lea    QRT_1(pc),a0
  1684.         lea    DDC_YN(pc),a1
  1685.         moveq    #3,d0
  1686.  
  1687.         move.l    a0,irt_itext(a6)    ;else pop up a
  1688.         move.l    a1,irt_tlist(a6)    ;QueryReq
  1689.         move.w    d0,irt_count(a6)
  1690.  
  1691.         bsr    DoQueryReq
  1692.  
  1693.         btst    #6,applic_flag2(a6)    ;"YES" gadget hit?
  1694.         beq.s    ERL_B2            ;skip if not
  1695.  
  1696. ERL_Z2        move.l    clue_list(a6),a0
  1697.         moveq    #1,d1            ;down clue
  1698.         bsr    GetClueText        ;get text ptr
  1699.         cmp.w    #2,d0            ;error?
  1700.         beq.s    ERL_B2            ;skip if so
  1701.  
  1702.         move.l    a0,clue_thisone(a6)    ;save text ptr
  1703.  
  1704.         bsr    ReOrderText        ;shuffle the text list
  1705.  
  1706. ERL_B2        moveq    #-1,d0            ;stop spurious
  1707.         move.w    d0,mp_across(a6)        ;square changing when
  1708.         move.w    d0,mp_down(a6)        ;quitting requester
  1709.  
  1710.         move.l    mw_handle(a6),a0
  1711.         move.l    mw_IDCMP(a6),d0
  1712.  
  1713.         CALLINT    ModifyIDCMP        ;make sure IDCMP back!
  1714.  
  1715.         move.l    mw_handle(a6),a0
  1716.         CALLINT    ActivateWindow
  1717.  
  1718.         rts
  1719.  
  1720. * TXAcross(a6)
  1721. * a6 = ptr to main program variables
  1722. * pop in the message for "XXXX Across" into the
  1723. * text for the above requester.
  1724.  
  1725. * d0-d1/a0-a1 corrupt
  1726.  
  1727.  
  1728. TXAcross        lea    IT_Alt1(pc),a0
  1729.         lea    ITT_Alt1(pc),a1
  1730.  
  1731.         move.l    a1,12(a0)    ;pop in text ptr
  1732.         move.w    #64,4(a0)    ;and starting x position
  1733.  
  1734.         move.l    16(a0),a0    ;ptr to next IText
  1735.  
  1736.         move.l    a1,12(a0)    ;pop in text ptr
  1737.         move.w    #63,4(a0)    ;and starting x position
  1738.  
  1739.         addq.l    #7,a1        ;point to "XXXX"
  1740.         move.l    a1,-(sp)        ;save ptr to number text
  1741.  
  1742.         move.l    a1,a0
  1743.         moveq    #0,d0
  1744.         move.w    pick_across(a6),d0    ;clue no.
  1745.         moveq    #4,d1            ;field width
  1746.         bsr    ItoA        ;integer to ASCII convert
  1747.  
  1748.         move.l    (sp)+,a1        ;recover pointer
  1749.  
  1750. TXA_1        tst.b    (a1)+        ;find the NULL inserted by ITOA
  1751.         bne.s    TXA_1
  1752.  
  1753.         move.b    #" ",-1(a1)    ;and put the space back
  1754.  
  1755.         rts
  1756.  
  1757.  
  1758. * TXDown(a6)
  1759. * a6 = ptr to main program variables
  1760. * pop in the message for "XXXX Across" into the
  1761. * text for the above requester.
  1762.  
  1763. * d0-d1/a0-a1 corrupt
  1764.  
  1765.  
  1766. TXDown        lea    IT_Alt1(pc),a0
  1767.         lea    ITT_Alt2(pc),a1
  1768.  
  1769.         move.l    a1,12(a0)    ;pop in text ptr
  1770.         move.w    #72,4(a0)    ;and starting x position
  1771.  
  1772.         move.l    16(a0),a0    ;ptr to next IText
  1773.  
  1774.         move.l    a1,12(a0)    ;pop in text ptr
  1775.         move.w    #71,4(a0)    ;and starting x position
  1776.  
  1777.         addq.l    #7,a1        ;point to "XXXX"
  1778.         move.l    a1,-(sp)        ;save ptr to number text
  1779.  
  1780.         move.l    a1,a0
  1781.         moveq    #0,d0
  1782.         move.w    pick_down(a6),d0    ;clue no.
  1783.         moveq    #4,d1        ;field width
  1784.         bsr    ItoA        ;integer to ASCII convert
  1785.  
  1786.         move.l    (sp)+,a1        ;recover pointer
  1787.  
  1788. TXD_1        tst.b    (a1)+        ;find the NULL inserted by ITOA
  1789.         bne.s    TXD_1
  1790.  
  1791.         move.b    #" ",-1(a1)    ;and put the space back
  1792.  
  1793.         rts
  1794.  
  1795.  
  1796. * Edit Clue Requester.
  1797.  
  1798.  
  1799. EdClueReq:
  1800.  
  1801.     dc.l    NULL
  1802.     dc.w    25,12
  1803.     dc.w    270,220
  1804.     dc.w    0,0
  1805.     dc.l    EdReqGList
  1806.     dc.l    NULL
  1807.     dc.l    NULL        ;EdReqTList
  1808.     dc.w    NULL
  1809.     dc.b    1,0
  1810.     dc.l    NULL
  1811.     dcb.b    32,0
  1812.     dc.l    NULL
  1813.     dc.l    NULL
  1814.     dcb.b    36,0
  1815.  
  1816.  
  1817. EdReqGList:
  1818.  
  1819. GetClue:
  1820.     dc.l    EdPanel
  1821.     dc.w    88,188
  1822.     dc.w    100,8
  1823.     dc.w    GADGIMAGE
  1824.     dc.w    GADGIMMEDIATE+RELVERIFY+ENDGADGET
  1825.     dc.w    STRGADGET+REQGADGET
  1826.     dc.l    GetClueBox
  1827.     dc.l    NULL
  1828.     dc.l    NULL
  1829.     dc.l    NULL
  1830.     dc.l    GetClueSInfo
  1831.     dc.w    NULL
  1832.     dc.l    DoneRG        ;extra entry!
  1833.     dc.l    QuitReq
  1834.  
  1835. GetClueSInfo:
  1836.     dc.l    GetClueSIBuff
  1837.     dc.l    UNDOBUFFER
  1838.     dc.w    0
  1839.     dc.w    256
  1840.     dc.w    0
  1841.     dc.w    0,0,0,0,0
  1842.     dc.l    0
  1843.     dc.l    0
  1844.     dc.l    NULL
  1845.  
  1846. GetClueSIBuff:
  1847.     dcb.b    256,0
  1848.     cnop    0,2
  1849.  
  1850. GetClueBox:
  1851.     dc.w    -5,-6
  1852.     dc.w    110,20
  1853.     dc.w    4
  1854.     dc.l    HBox2Data
  1855.     dc.b    $000F,$0000
  1856.     dc.l    NULL
  1857.  
  1858. EdPanel:
  1859.     dc.l    NULL
  1860.     dc.w    0,0
  1861.     dc.w    270,220
  1862.     dc.w    GADGHBOX+GADGHIMAGE+GADGIMAGE
  1863.     dc.w    NULL
  1864.     dc.w    BOOLGADGET+REQGADGET
  1865.     dc.l    PanelImage
  1866.     dc.l    NULL
  1867.     dc.l    EdReqTList
  1868.     dc.l    NULL
  1869.     dc.l    GetClueSInfo
  1870.     dc.w    NULL
  1871.     dc.l    NULL
  1872.     dc.l    NULL        ;extra entry!
  1873.  
  1874.  
  1875. EdReqTList:
  1876. IT_15:
  1877.     dc.b    9,0,RP_JAM1,0
  1878.     dc.w    64,13
  1879.     dc.l    NULL
  1880.     dc.l    ITT15
  1881.     dc.l    IT_16
  1882.  
  1883. ITT15:
  1884.     dc.b    'Edit Clue Question',0
  1885.     cnop    0,2
  1886.  
  1887. IT_16:
  1888.     dc.b    1,0,RP_JAM1,0
  1889.     dc.w    63,12
  1890.     dc.l    NULL
  1891.     dc.l    ITT15
  1892.     dc.l    IT_Alt1
  1893.  
  1894. IT_Alt1:
  1895.     dc.b    4,0,RP_JAM1,0
  1896.     dc.w    64,49
  1897.     dc.l    NULL
  1898.     dc.l    ITT_Alt1
  1899.     dc.l    IT_Alt2
  1900.  
  1901. ITT_Alt1:
  1902.     dc.b    "Clue : XXXX Across",0
  1903.  
  1904. ITT_Alt2:
  1905.     dc.b    "Clue : XXXX Down",0
  1906.     cnop    0,2
  1907.  
  1908. IT_Alt2:
  1909.     dc.b    5,0,RP_JAM1,0
  1910.     dc.w    63,48
  1911.     dc.l    NULL
  1912.     dc.l    ITT_Alt1
  1913.     dc.l    IT_17
  1914.  
  1915. IT_17:
  1916.     dc.b    9,0,RP_JAM1,0
  1917.     dc.w    32,63
  1918.     dc.l    NULL
  1919.     dc.l    ITT17
  1920.     dc.l    IT_18
  1921.  
  1922. ITT17:
  1923.     dc.b    'Enter New Clue Text In The',0
  1924.     cnop    0,2
  1925.  
  1926. IT_18:
  1927.     dc.b    1,0,RP_JAM1,0
  1928.     dc.w    31,62
  1929.     dc.l    NULL
  1930.     dc.l    ITT17
  1931.     dc.l    IT_19
  1932.  
  1933. IT_19:
  1934.     dc.b    9,0,RP_JAM1,0
  1935.     dc.w    36,77
  1936.     dc.l    NULL
  1937.     dc.l    ITT19
  1938.     dc.l    IT_20
  1939.  
  1940. ITT19:
  1941.     dc.b    'Box Below, And Then Press',0
  1942.     cnop    0,2
  1943.  
  1944. IT_20:
  1945.     dc.b    1,0,RP_JAM1,0
  1946.     dc.w    35,76
  1947.     dc.l    NULL
  1948.     dc.l    ITT19
  1949.     dc.l    IT_21
  1950.  
  1951. IT_21:
  1952.     dc.b    9,0,RP_JAM1,0
  1953.     dc.w    72,91
  1954.     dc.l    NULL
  1955.     dc.l    ITT21
  1956.     dc.l    IT_22
  1957.  
  1958. ITT21:
  1959.     dc.b    'The "Enter" Key.',0
  1960.     cnop    0,2
  1961.  
  1962. IT_22:
  1963.     dc.b    1,0,RP_JAM1,0
  1964.     dc.w    71,90
  1965.     dc.l    NULL
  1966.     dc.l    ITT21
  1967.     dc.l    NULL
  1968.  
  1969.  
  1970.  
  1971.  
  1972.  
  1973.  
  1974.